package org.dyz.banana.platform.common.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.dyz.banana.platform.common.vo.TPermissionVo;
import org.dyz.banana.platform.common.vo.TRoleVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 * 角色 Mapper 接口
 * </p>
 *
 * @author dongyongzhao
 * @since 2021-04-12
 */
public interface TRoleMapper extends BaseMapper<TRoleVo> {

	@Select(value = { "Select t_role.* "
			+ "from t_role t_role,"
			+ "t_user_role t_user_role, "
			+ "t_user t_user "
			+ "where t_user.user_name=#{username} and t_user.defun_ind='0' "
			+ "and t_user.user_id=t_user_role.user_id and t_user_role.defun_ind='0' "
			+ "and t_role.role_id = t_user_role.role_id and t_role.defun_ind='0' " })
	public List<TRoleVo> getRoleByUsername(@Param("username")String username);
}
